package com.yanqu.road.entity.activity.evefeast;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.DataStatus;
import com.yanqu.road.entity.FieldTypeAnnotation;

import java.util.ArrayList;
import java.util.List;

@FieldTypeAnnotation(tableName = "t_u_activity_evefeast")
public class UserEveFeastData extends DataObject {
    @FieldTypeAnnotation(select = true, isIndex = true, update = true)
    private int activityId;
    @FieldTypeAnnotation(desc = "玩家id", select = true, isIndex = true, update = true)
    private long userId;
    @FieldTypeAnnotation(desc = "每日游戏次数")
    private int gameTimes;
    @FieldTypeAnnotation(desc = "单局最高分")
    private int maxScore;
    @FieldTypeAnnotation(desc = "最高分阵容")
    private List<EveFeastItem> maxScoreItems = new ArrayList<>();
    @FieldTypeAnnotation(desc = "战令购买状态1")
    private boolean buyToken1;
    @FieldTypeAnnotation(desc = "战令购买状态2")
    private boolean buyToken2;
    @FieldTypeAnnotation(desc = "游戏数据")
    private EveFeastGameData gameData;
    @FieldTypeAnnotation(desc = "补发用的评价奖励")
    private String autoReward= "";
    @FieldTypeAnnotation(desc = "练习模式数据")
    private EveFeastGameData practiceData;
    @FieldTypeAnnotation(desc = "引导步骤,0-未引导,1-已引导")
    private int guideStep;
    @FieldTypeAnnotation(desc = "最后一次游戏时间")
    private long lastGameTime;

    public UserEveFeastData(int activityId, long userId) {
        this.activityId = activityId;
        this.userId = userId;
        setInsertOption();
    }

    public UserEveFeastData() {
    }

    public int getActivityId() {
        return activityId;
    }

    public void setActivityId(int activityId) {
        this.activityId = activityId;
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public int getGameTimes() {
        return gameTimes;
    }
    public void setGameTimes(int gameTimes) {
        if (this.gameTimes != gameTimes) {
            this.gameTimes = gameTimes;
            setOp(DataStatus.Update);
        }
    }

    public int getMaxScore() {
        return maxScore;
    }

    public void setMaxScore(int maxScore) {
        if (this.maxScore != maxScore) {
            this.maxScore = maxScore;
            setOp(DataStatus.Update);
        }
    }

    public List<EveFeastItem> getMaxScoreItems() {
        return maxScoreItems;
    }

    public void setMaxScoreItems(List<EveFeastItem> maxScoreItems) {
        this.maxScoreItems = new ArrayList<>(maxScoreItems);
        setUpdateOption();
    }

    public boolean getBuyToken1() {
        return buyToken1;
    }

    public void setBuyToken1(boolean buyToken1) {
        if (this.buyToken1 != buyToken1) {
            this.buyToken1 = buyToken1;
            setOp(DataStatus.Update);
        }
    }

    public boolean getBuyToken2() {
        return buyToken2;
    }

    public void setBuyToken2(boolean buyToken2) {
        if (this.buyToken2 != buyToken2) {
            this.buyToken2 = buyToken2;
            setOp(DataStatus.Update);
        }
    }

    public EveFeastGameData getGameData() {
        return gameData;
    }
    public void setGameData(EveFeastGameData gameData) {
        this.gameData = gameData;
        setOp(DataStatus.Update);
    }

    public int getGuideStep() {
        return guideStep;
    }

    public void setGuideStep(int step) {
        guideStep = step;
        setUpdateOption();
    }

    public long getLastGameTime() {
        return lastGameTime;
    }

    public void setLastGameTime(long lastGameTime) {
        this.lastGameTime = lastGameTime;
        setUpdateOption();
    }

    public EveFeastGameData getPracticeData() {
        return practiceData;
    }

    public void setPracticeData(EveFeastGameData practiceData) {
        this.practiceData = practiceData;
        setUpdateOption();
    }

    public String getAutoReward() {
        return autoReward;
    }

    public void setAutoReward(String autoReward) {
        this.autoReward = autoReward;
        setUpdateOption();
    }
}
